Full text of "Gadgets"
The Awesome Button
.1
Make Projects
build, hack, tweak, share, discover.
The Awesome Button
Written By: Matt Richardson
TOOLS:
Computer (1)
Drill and drill bits (1)
The SparkFun button needs a 1 " hole
saw; your button may vary.
Multimeter (1)
for troubleshooting
Screwdriver (1)
Soldering iron and solder (1)
Wire cutter/stripper (1)
PARTS:
Teensy USB development board, version
2-0(1)
$16 from PJRC (pjrc.com). This tiny
USB microcontroller can be programmed
to act like a USB Human Interface
Device, such as a keyboard, mouse, or
joystick. Since we want the Awesome
Button to type words in for us. we'll set it
up as a keyboard.
Switch, momentary (1)
/ used a big red one, item #9181 from
SparkFun (sparkfun.com).
Rubber feet (1)
Enclosure (1)
/ used item #270- 1807 from RadioShack
(radioshack.com). You could also use a
spare cardboard box, or laser-cut a
custom enclosure.
Wire, insulated. 22 gauge (1)
USB cable. standard-A to mini-B (1)
You probably have a few spares lying
© Make Projects
www.makeprojects.com
Page 1 of 8
The Awesome Button
around.
Mounting tape (1)
Heat-shrink tubing (1)
You could use electrical tape instead.
SUMMARY
Ever since I started writing for MAKE, I've kept an eye on all the awesome websites out
there for awesome makers and the awesome projects that are posted every day. Luckily for
me, there's no shortage of awesome work to write about. My only difficulty was I needed
more words to describe how awesome this stuff is.
To fix this problem, I created the Awesome Button, my own custom USB input device that
keys in a random synonym for awesome, on demand. With the Awesome Button, when I'm
writing about a project that I like a lot and I get stuck on how to describe it, I hit the big red
button on my desk and it takes care of the adjective. Now instead of awesome this and
awesome that, I'm writing about incredible robots, fantastic camera hacks, and cool
electronics projects.
Step 1 — Install the Button.
• Measure to find the center of your
enclosure and drill a hole for your
button. For the SparkFun button,
the diameter should be 1".
• Remove the snap-action switch
and the LED assembly from the
bottom of the button.
© Make Projects
www.makeprojects.com
Page 2 of 8
The Awesome Button
Step 2
• Place the button through the hole, screw the ring down, and replace the snap-action switch
and LED assembly.
Step 3 — Wire the switch.
• Solder a 6" length of wire to the
terminal marked "NO," which
means the circuit between this
terminal and the common terminal
is "normally open." When we press
the button, it will close the
connection between the common
and NO terminals.
• Solder another 6" wire to the
terminal marked "Common."
• Note: There's no pull-up or
pull-down resistor for this
digital switch circuit because the
code will activate the internal pull-
up feature of the ATmega32U4 chip
on the Teensy USB board.
© Make Projects
www.makeprojects.com
Page 3 of 8
The Awesome Button
Step 4 — Connect the switch to the Teensy.
• Solder one wire from the button to a ground pin on the Teensy.
• Solder the other wire from the button to the pin marked BO.
• Attach the Teensy to the enclosure using a small piece of mounting tape.
© Make Projects
www.makeprojects.com
Page 4 of 8
The Awesome Button
Step 5 — Mod the enclosure.
tSS
• Drill a hole just wide enough for your USB cable to fit through.
• For a cleaner look (optional), make this hole the width of the cable itself, not the plugs;
then you can cut the cable and feed it through the hole.
• Place 4 rubber feet on the bottom corners of the enclosure.
• Note: To give the Awesome Button a clean look from the outside, I made the hole
for the cable just wide enough for the cable itself, not the plugs. (You can skip this
step to save time — just tie a good strain-relief knot in the cable inside the box.)
Step 6 — Mod the USB cable (optional).
• Cut the USB cord about 3" from the mini-B side (the smaller of the 2 connectors) and set it
aside.
• Feed the long end of the cord through the hole in the enclosure, from the outside.
• Strip the outer insulation off the cable on each end, and peel away the foil shielding. Strip
each of the individual wires inside the cable.
© Make Projects www.makeprojects.com Page 5 of 8
The Awesome Button
Step 7
• On one cable end, place a piece of heat-shrink tubing on each wire. Then connect the
matching wires and solder them together. Slip the heat-shrink over the solder joint and use
your soldering iron, hot air, or a lighter flame to shrink it around the joint. You can also use
electrical tape.
• When you've reconnected all the wires, wrap the bundle with electrical tape.
• Plug the the mini-USB plug into the Teensy, and close up the enclosure. Then plug the
other end into your computer.
© Make Projects
www.makeprojects.com
Page 6 of 8
The Awesome Button
Step 8 — Upload the code.
• Download and install the Arduino
integrated development
environment (IDE) from
arduino.cc/en/Main/Software .
• Install Teensy Loader from
pjrc.com/teensy/loader.html . Install
Teensyduino from
pjrc.com/teensy/teensyduino.html .
This allows you to use Arduino
code and the Arduino IDE to
program the Teensy USB
microcontroller.
• Download the Awesome Button
code from
github.com/mrichardson23/ Awesome-
Button and open it in the Arduino
IDE. If you'd like to make changes
to the list of words, add them to the
words array in lines 3-5.
• Make sure that the value of the
number_of_words constant on
line 1 is equal to the number of
words in the words array.
• Under the Tools menu, click Board
and choose Teensy 2.0.
• Under the Tools menu, click USB
Type and select Keyboard + Mouse
+ Joystick.
• Click the Upload button. A window
will appear instructing you to press
the button on the Teensy to upload
the code.
© Make Projects
www.makeprojects.com
Page 7 of 8
The Awesome Button
Let's get unawesome!
Plug the Awesome Button into the USB port of any computer. On a machine that isn't familiar
with the device, your operating system may prompt you to hit a particular key so that it can
identify the layout of what it thinks is a keyboard. In most cases, you can safely dismiss this
dialog box and it won't bother you again.
When you're writing and you're about to type your overused word, instead slam your hand down
on the Awesome Button and it will key in a random synonym so that you don't have to worry
about which one to use.
If the word that pops up isn't working for you, you can easily delete it: tap Control-Shift-left arrow
on a PC or Option-Shift-left arrow on a Mac to highlight the word and then hit Delete. You could
program this key combination into the Awesome Button itself. Or modify the code so that if the
button is held down for more than 1 second, it will delete the previous word! Or add a small
panel-mount momentary switch to the side of the Awesome Button to do the same thing.
Whatever you do, it'll be ... fantastic!
This document was last generated on 2012-11-18 11:20:00 AM.
© Make Projects www.makeprojects.com Page 8 of 8